package com.it.controller;

import com.it.entity.adjustment.AiClaimCalculation;
import com.it.service.AiClaimCalculationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import utils.R;

/**
 * <p>
 * 保险金额理算表（立案后计算赔付金额） 前端控制器
 * </p>
 *
 * @author lutao
 * @since 2025年09月23日
 */
@RestController
@RequestMapping("/aiClaimCalculation")
public class AiClaimCalculationController {
    @Autowired
    private AiClaimCalculationService aiClaimCalculationService;

    @PostMapping("/addAdjustment")
    public R addAdjustment(@RequestBody AiClaimCalculation aiClaimCalculation){

        return aiClaimCalculationService.addAdjustment(aiClaimCalculation);
    }

    @GetMapping("/CalculationList")
    public R CalculationList(@RequestParam(value="pageNum",defaultValue = "1",required = false) Integer pageNum,
                             @RequestParam(value="pageSize",defaultValue = "5",required = false) Integer pageSize,
                             @RequestParam(value="calculationStatus",required = false) Integer calculationStatus){
        return aiClaimCalculationService.CalculationList(pageNum,pageSize,calculationStatus);
    }

    @GetMapping("/CalculationById")
    public R CalculationById(@RequestParam(value="calculationId",required = false) String calculationId){
        return aiClaimCalculationService.CalculationById(calculationId);
    }

    //根据报案号查询理算信息
    @GetMapping("/byReportNo")
    public R getByReportNo(@RequestParam("reportNo") String reportNo,
                           @RequestParam("calculationStatus") Integer calculationStatus){
        return aiClaimCalculationService.getByReportNo(reportNo,calculationStatus);
    }

}
